/**
 * Copyright &copy; 2016 CNJSON All rights reserved.
 */
package com.hongsuan.pplive.modules.cms.entity;

import org.compass.annotations.Index;
import org.compass.annotations.Searchable;
import org.compass.annotations.SearchableComponent;
import org.compass.annotations.SearchableId;
import org.compass.annotations.SearchableProperty;
import org.compass.annotations.Store;
import org.hibernate.validator.constraints.Length;

import com.cnjson.db.persistence.DataEntity;

/**
 * 视频管理Entity
 * @author Susan
 * @version 2015-11-26
 */
@Searchable
public class Video extends DataEntity<Video> {

	private static final long serialVersionUID = 1L;
    @SearchableId(store= Store.YES,index= Index.UN_TOKENIZED,name="id")
    private String id;
    @SearchableComponent
    private Category category;// 分类编号
    @SearchableProperty(name="title",index= Index.ANALYZED,store= Store.YES)
	private String title;		// 标题
	private String image;		// 视频图片
	private String url;		// 视频URL，可以直接访问
    @SearchableProperty(name="keywords",index= Index.ANALYZED,store= Store.YES)
	private String keywords;		// 关键字

	public Video() {
		super();
	}

	public Video(String id){
        this();
        this.id = id;
	}

    public Video(Category category){
        this();
        this.category = category;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

	@Length(min=1, max=255, message="标题长度必须介于 1 和 255 之间")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Length(min=0, max=255, message="视频图片长度必须介于 0 和 255 之间")
	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	@Length(min=1, max=2000, message="视频URL，可以直接访问长度必须介于 1 和 2000 之间")
	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	@Length(min=0, max=255, message="关键字长度必须介于 0 和 255 之间")
	public String getKeywords() {
		return keywords;
	}

	public void setKeywords(String keywords) {
		this.keywords = keywords;
	}

}